home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / Demos_Files / DLL / PREPOST.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.3 KB  |  39 lines

  1. // Dynamic link library implementation of a generic pre/post-processor
  2.  
  3. #include "NSDLL.h" 
  4.  
  5. /***************************/
  6. /* Activation of component */
  7. __declspec(dllexport) BOOL performPrePost(
  8.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  9.     NSFloat    *input,     // Pointer to the input data
  10.     NSFloat    *output,     // Pointer to the output data
  11.     int rows,         // Number of rows of data
  12.     int cols         // Number of cols of data
  13.     )
  14. {
  15.     int i, length=rows*cols;
  16.     for (i=0; i<length; i++)
  17.         output[i] += input[i];
  18.     return TRUE;    // Return whether to inject this sample or to call performPrePost with another sample
  19. }
  20.  
  21. /******************************************/
  22. /* Management of instance data (OPTIONAL) */
  23. /*
  24. __declspec(dllexport) DLLData *allocPrePost(
  25.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  26.     int *rows,         // Number of rows of output data, can be changed to reflect a diffenent number for the input data
  27.     int *cols,         // Number of cols of output data, can be changed to reflect a diffenent number for the input data
  28.     BOOL preprocessor    // Flag to indicate whether this is a preprocessor or postprocessor
  29.     )
  30. {
  31.     DLLData *instance = allocDLLInstance(oldInstance);
  32.     return instance;
  33. }
  34.  
  35. __declspec(dllexport) void freePrePost(DLLData *instance)
  36. {
  37.     freeDLLInstance(instance); 
  38. }
  39. */